package cn.wondertek.cms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.wondertek.common.core.domain.R;
import cn.wondertek.common.core.controller.BaseController;
import cn.wondertek.system.domain.CmsSysUserRoleMenu;
import cn.wondertek.cms.service.ICmsSysUserRoleMenuService;

/**
 * 【请填写功能名称】 提供者
 *
 * @author ruoyi
 * @date 2020-06-01
 */
@RestController
@RequestMapping("userMenu")
public class CmsSysUserRoleMenuController extends BaseController
{

	@Autowired
	private ICmsSysUserRoleMenuService cmsSysUserRoleMenuService;

	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{rmId}")
	public CmsSysUserRoleMenu get(@PathVariable("rmId") Long rmId)
	{
		return cmsSysUserRoleMenuService.selectCmsSysUserRoleMenuById(rmId);

	}

	/**
	 * 查询【请填写功能名称】列表
	 */
	@GetMapping("list")
	public R list(CmsSysUserRoleMenu cmsSysUserRoleMenu)
	{
		startPage();
        return result(cmsSysUserRoleMenuService.selectCmsSysUserRoleMenuList(cmsSysUserRoleMenu));
	}


	/**
	 * 新增保存【请填写功能名称】
	 */
	@PostMapping("save")
	public R addSave(@RequestBody CmsSysUserRoleMenu cmsSysUserRoleMenu)
	{
		return toAjax(cmsSysUserRoleMenuService.insertCmsSysUserRoleMenu(cmsSysUserRoleMenu));
	}

	/**
	 * 修改保存【请填写功能名称】
	 */
	@PostMapping("update")
	public R editSave(@RequestBody CmsSysUserRoleMenu cmsSysUserRoleMenu)
	{
		return toAjax(cmsSysUserRoleMenuService.updateCmsSysUserRoleMenu(cmsSysUserRoleMenu));
	}

	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{
		return toAjax(cmsSysUserRoleMenuService.deleteCmsSysUserRoleMenuByIds(ids));
	}

}
